<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // class类的constrctor并不是必须写的函数 比如下方这中只包含一些公共方法的类
        // class Game {
        //     play() {
        //         console.log('这是一个play方法');
        //     }
        // }
        // ----------------------------------------------------------------------
        class Game {
            constructor(name, type) {
                this.name = name
                this.type = type
            }
        }

        class Role extends Game {
            // constructor(roleName, hit, sex, gameName, type) {
            //     super()
            //         // super(gameName, type)
            //         // this.roleName = roleName
            //         // this.hit = hit
            //         // this.sex = sex
            // }
            dance() {

            }
        }

        let game = new Role('王者荣耀', '手游')
        console.log(game);
    </script>
</body>

</html>